import React, { Component } from 'react';

// 引入子组件
import Child from './Child';
import axios from 'axios'
class Father extends Component {
    state = {
        schoolArr: []
    }
    render() {
        return (
            <div>
                {/* 使用子组件 */}
                <Child schoolArr={this.state.schoolArr}></Child>
            </div>
        );
    };
    componentDidMount() {
        axios.get('https://api.i-lynn.cn/college').then(res => {
            console.log(res);
            this.setState({
                schoolArr: res.data.data.list1
            })
        })
    }
}

export default Father;
